tem=int(input())
tem_unit=input()
height=int(input())
height_unit=input()
if tem_unit=='F':
   tem_c=(tem-32)*5/9
else:tem_c=tem
if height_unit=='ft':
   height_m=height*0.3048
else:height_m=height

point=100-(height_m/300)

if tem_c<0:
    state="solid"
elif tem_c<point:
    state="liquid"
else:state="gaseous"
print(state)